package org.geotools.tutorial.feature;

import java.io.File;

import org.geotools.swing.data.JFileDataStoreChooser;
import org.geotools.toolbox.ShpProjection;
import org.geotools.utils.FileUtils;

public class SHPPROJ {
	public static void main(String[] args) throws Exception {
		File file = JFileDataStoreChooser.showOpenFile("shp", null);
		if (file == null) {
			return;
		}
		JFileDataStoreChooser chooser = new JFileDataStoreChooser("shp");
		chooser.setDialogTitle("Save reprojected shp");

		int returnVal = chooser.showSaveDialog(null);

		if (returnVal != JFileDataStoreChooser.APPROVE_OPTION) {
			// the user canceled the dialog
			System.exit(0);
		}
		File outproj = chooser.getSelectedFile();
		ShpProjection.execute(file.toString(), "EPSG:3857", outproj.toString());
	}
}
